﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RoleManagement.aspx.cs" Inherits="CSM.Views.Management.RoleManagement" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
<script type="text/javascript" src="../../Js/jquery.js"></script>
<script src="../../Js/jquery.autocomplete.min.js" type="text/javascript"></script> 
<script type="text/javascript" src="../../Js/thickbox.js"></script>
<link href="../../App_Themes/Default_1/jquery.autocomplete.css" type="text/css" rel="stylesheet"/> 
<link rel="stylesheet" href="../../App_Themes/Default_1/thickbox.css" type="text/css" media="screen" />
<script language="javascript" type="text/javascript">
    $(document).ready((function() {
        //由SERVER端获得
        $("#txtUser").autocomplete("GetData.ashx?database=TCsm_JS_Role&which=RoleName");
    }
));
function ShowThickBox_aspx(url,id,title) {
        var dir=url;
        var uid=id;
        imgLoader = new Image(); // preload image
        imgLoader.src = tb_pathToImage;
        window.tb_show(title, dir+"?roleid=" + uid + "&height=300&width=450", "");
    };
    function ShowThickBox_div(b, a) {
        var div = a;
        var title = b;
        imgLoader = new Image(); // preload image
        imgLoader.src = tb_pathToImage;
        window.tb_show(title, "#TB_inline?height=300&width=400&inlineId=" + div, "");
    };
    function closewind() {window.tb_remove();};
   </script>
</head>
<body class = "CommonPage_Body">
    <form id="form1" runat="server">


    
        <table >

            <tr>
                <td >
                   
                    <asp:Button ID="Button_Add" runat="server" oncommand="Button_Add_Command" 
                        Text="增加"  SkinID ="Button" />
                    
                    <asp:Label ID="Label_RoleInfo" runat="server" Visible="False" SkinID ="Label" ></asp:Label>
                </td>
                <td >
                    </td>
            </tr>
            <tr><td><asp:TextBox ID="txtUser" runat="server" ></asp:TextBox><asp:Button ID="Button_Browse" runat="server" Text="查询" skinid="Button" 
                            onclick="Button_Browse_Click"/></td></tr>
            <tr>
                <td >
                    

                        <asp:Panel ID="Panel_RoleList" runat="server" >
                                                <asp:LinkButton ID="LinkButton_First" runat="server" CommandArgument="First" 
                            OnClick="MyClick" ><img src = "../../App_Themes/Default_1/Images/Page_First.gif" class = "Page_First"alt = "首页" /></asp:LinkButton>                
                        <asp:LinkButton ID="LinkButton_Prev" runat="server" CommandArgument="Prev" 
                            OnClick="MyClick"><img  src = "../../App_Themes/Default_1/Images/Page_Prev.gif" class = "Page_Prev"  alt = "上页"/></asp:LinkButton>               
                        <asp:LinkButton ID="LinkButton_Next" runat="server" CommandArgument="Next" 
                            OnClick="MyClick"><img  src = "../../App_Themes/Default_1/Images/Page_Next.gif"  class = "Page_Next"  alt = "下页"/></asp:LinkButton>                      
                        <asp:LinkButton ID="LinkButton_Last" runat="server" CommandArgument="Last" 
                            OnClick="MyClick"><img   src = "../../App_Themes/Default_1/Images/Page_Last.gif" class = "Page_Last" alt = "末页"/></asp:LinkButton>
                        <asp:Label ID="Label_Total" runat="server" Text="共："  SkinID ="Label"></asp:Label>
                        <asp:Label ID="Label_CurrenPageAndTo" runat="server" Text="页，当前第 页，转到"  SkinID ="Label"></asp:Label>
                        <asp:TextBox ID="TextBox_PageIndex" runat="server" Width="26px"></asp:TextBox>
                        <asp:Label ID="Label4" runat="server" Text="页"  SkinID ="Label"></asp:Label>
                        <asp:RangeValidator ID="RangeValidator_PageIndex" runat="server" ControlToValidate="TextBox_PageIndex"
                            ErrorMessage="*" MaximumValue="10000" MinimumValue="1" Type="Integer"></asp:RangeValidator>
                        <asp:Button ID="Button_PageGo" runat="server" CommandArgument="GotoPage" OnClick="MyClick"
                            Text="GO"  SkinID ="Button" />                        <asp:GridView ID="GridView_Roles" runat="server"  SkinID ="gridview" AutoGenerateColumns="False">
                            <Columns>
                                <asp:BoundField DataField="RoleID" HeaderText="角色ID" ReadOnly="True" 
                                    SortExpression="角色ID" />
                                <asp:BoundField DataField="RoleName" HeaderText="角色名称" ReadOnly="True" 
                                    SortExpression="角色名称" />
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:Button ID="Button_Right" runat="server" 
                                            CommandArgument='<%# Eval("RoleID") %>' oncommand="Button_Right_Command" 
                                            Text="编辑权限"  SkinID ="Button" />
                                        <asp:Button ID="Button_Del" runat="server" oncommand="Button_Del_Command" OnClientClick="return comfirm('确定要删除该角色？');"
                                            Text="删除" CommandArgument='<%# Eval("RoleID") %>' SkinID ="Button" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </asp:Panel>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="style1">
                        
                    </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style1">
                    <asp:Panel ID="Panel_Edit" runat="server" Visible="False">
                        <table style="width:100%;">
                            <tr>
                                <td>
                                    <asp:Label ID="Label1" runat="server" Text="角色名称" SkinID="Label"></asp:Label>
                                </td>
                                <td class="style2">
                                    <asp:TextBox ID="TextBox_Name" runat="server" SkinID="TextBox"></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            
                            <tr>
                                <td>
                                    <asp:Button ID="Button_Save" runat="server" oncommand="Button_Save_Command" 
                                        Text="保存" SkinID ="Button"  />
                                    <asp:Button ID="Button_Cancel" runat="server" oncommand="Button_Cancel_Command" 
                                        Text="取消" SkinID ="Button"  />
                                </td>
                                <td class="style2">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:HiddenField ID="CurrentPage" runat="server" Value="0" />
                                </td>
                                <td class="style2">
                                    <asp:HiddenField ID="EditFlag" runat="server" Value="0" />
                                </td>
                                <td>
                                    <asp:HiddenField ID="RoleInfo" runat="server" Value="0" />
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
 <div id = "MyThickBox"></div>
    </form>
</body>
</html>